﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharePoint2007Migration.Costants;
using SharePoint2007Migration.Domain;

namespace SharePoint2007Migration
{

    public class MissingAssemblyIssue : BaseIssue, IBaseIssue
    {

        string _assemblyKeyToken;
        public MissingAssemblyIssue(IBaseIssue issue)
            : base(issue.Text)
        {
            // trick per concedere l' upcasting 
        }

        public string AssemblyKeyToken 
        {
            get
            {
                if (_assemblyKeyToken == null)
                    _assemblyKeyToken = Get_assemblyKeyToken();
                return _assemblyKeyToken;
            }
        }

        private string Get_assemblyKeyToken()
        {
           return ExtractAndCleanupStringFromMessage(RegexCostants.REGEX_ASSEMBLY_PUBLIC_KEY_TOKEN, "Assembly [", "]");
        }
    }
}
